// 智慧产业-区重点项目管理
import request from '@/utils/request'
import { BASE_URL } from '@/api/config.js'

// 新增项目信息
export function addProjectInfo(data) {
  return request({
    method: 'post',
    url: '/zhjs/inspection/record/addOrUpdate',
    data: data
  })
}

// 查询项目列表
export function queryProjectList(params) {
  return request({
    method: 'get',
    url: '/zhjs/inspection/record/query',
    params
  })
}

// 删除项目
export function deleteProjectInfo(pkid) {
  return request({
    method: 'delete',
    url: `/zhjs/inspection/record/delete?pkid=${pkid}`
  })
}

// 查询项目详情
export function queryProjectDetail(pkid) {
  return request({
    method: 'get',
    url: `/zhjs/inspection/record/get?pkid=${pkid}`
  })
}

// 巡查记录导出
export function projectFileDownload(params) {
  return request({
    method: 'get',
    responseType: 'blob',
    params,
    url: '/zhjs/inspection/record/export',
    timeout: 0
  })
}

// 获取附件链接
export function securityFileUrl(pkid) {
  return `${
    process.env.NODE_ENV === 'production'
      ? BASE_URL
      : '/api'
  }/zhjs/inspection/record/download?pkid=${pkid}`
}

// 退回项目
export function backProjectInfo(params) {
  return request({
    method: 'get',
    url: '/zhjs/inspection/record/backStatus',
    params
  })
}
